// devops/pages/apply/apply.js
import service from '../../../utils/request'
let content = null;
let touchs = [];
let canvasw = 0;
let canvash = 0;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info: {},
    chargeOrder:{},
    visible: false,
    gunId: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if(options.gunId){
      this.setData({
        gunId: options.gunId
      })
    }
  },
  onClose(){
    this.setData({
      visible: !this.data.visible
    })
  },
  downAgreement (){
    wx.downloadFile({
      url: 'https://*******',//文件路径
      success: function (res) {
        const filePath = res.tempFilePath
        wx.openDocument({
          filePath: filePath,
          showMenu: true,
          success: function (res) {
            console.log('打开文档成功')
          }
        })
      }
    })
  },

    // 
    getQuery(){
      let that = this
      // let sear = {state: 3,id: e.target.dataset.id, installTime: '2022-05-12 12:00:00'}
      service("GET","/personal/apply/agreement/pile/view/"+this.data.gunId).then(res => {
       console.log('res', res)
       if(res.data.pile){
        that.setData({
          info: res.data.pile
         })
       }
       
      })
    },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */

  onShow: function () {
    this.getQuery()
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})